home *** CD-ROM | disk | FTP | other *** search
/ Hardcore Visual Basic 5.0 (2nd Edition) / Hardcore Visual Basic 5.0 - Second Edition (1997)(Microsoft Press).iso / Code / FUN.FRM < prev    next >
Text File  |  1997-06-14  |  19KB  |  644 lines

  1. VERSION 5.00
  2. Object = "{35DFF7C3-DEB3-11D0-8C50-00C04FC29CEC}#1.0#0"; "PictureGlass.ocx"
  3. Begin VB.Form FFun 
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Fun 'n Games"
  6.    ClientHeight    =   6660
  7.    ClientLeft      =   1908
  8.    ClientTop       =   2076
  9.    ClientWidth     =   6708
  10.    ClipControls    =   0   'False
  11.    FillColor       =   &H00FF00FF&
  12.    BeginProperty Font 
  13.       Name            =   "MS Sans Serif"
  14.       Size            =   7.8
  15.       Charset         =   0
  16.       Weight          =   700
  17.       Underline       =   0   'False
  18.       Italic          =   0   'False
  19.       Strikethrough   =   0   'False
  20.    EndProperty
  21.    Icon            =   "fun.frx":0000
  22.    LinkTopic       =   "Form1"
  23.    MaxButton       =   0   'False
  24.    MinButton       =   0   'False
  25.    ScaleHeight     =   6660
  26.    ScaleWidth      =   6708
  27.    Begin PictureGlass.XPictureGlass pgControl 
  28.       Height          =   1095
  29.       Left            =   2400
  30.       TabIndex        =   15
  31.       Top             =   2040
  32.       Width           =   1215
  33.       _ExtentX        =   2138
  34.       _ExtentY        =   1926
  35.       BackColor       =   -2147483628
  36.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  37.          Name            =   "MS Sans Serif"
  38.          Size            =   7.8
  39.          Charset         =   0
  40.          Weight          =   700
  41.          Underline       =   0   'False
  42.          Italic          =   0   'False
  43.          Strikethrough   =   0   'False
  44.       EndProperty
  45.       ScaleWidth      =   1215
  46.       ScaleMode       =   0
  47.       ScaleHeight     =   1095
  48.    End
  49.    Begin VB.CommandButton cmdLargeBmp 
  50.       Caption         =   "Large"
  51.       Height          =   384
  52.       Left            =   696
  53.       TabIndex        =   14
  54.       Top             =   5688
  55.       Width           =   945
  56.    End
  57.    Begin VB.CommandButton cmdAniBmp 
  58.       Caption         =   "Animate"
  59.       Height          =   384
  60.       Left            =   696
  61.       TabIndex        =   13
  62.       Top             =   6168
  63.       Width           =   945
  64.    End
  65.    Begin VB.CommandButton cmdSmallBmp 
  66.       Caption         =   "Small"
  67.       Height          =   384
  68.       Left            =   696
  69.       TabIndex        =   12
  70.       Top             =   5196
  71.       Width           =   945
  72.    End
  73.    Begin VB.CheckBox chkAutoRedraw 
  74.       Caption         =   "Auto Redraw"
  75.       Height          =   360
  76.       Left            =   4968
  77.       TabIndex        =   11
  78.       Top             =   6228
  79.       Width           =   1575
  80.    End
  81.    Begin VB.CommandButton cmdAnimateCtl 
  82.       Caption         =   "Animate &Control"
  83.       Height          =   375
  84.       Left            =   4968
  85.       TabIndex        =   10
  86.       Top             =   1533
  87.       Width           =   1575
  88.    End
  89.    Begin VB.CommandButton cmdSpiralBmp 
  90.       Caption         =   "Spiral Bitmap"
  91.       Height          =   375
  92.       Left            =   4968
  93.       TabIndex        =   9
  94.       Top             =   581
  95.       Width           =   1575
  96.    End
  97.    Begin VB.CheckBox chkClip 
  98.       Caption         =   "Clip Controls"
  99.       Height          =   468
  100.       Left            =   4968
  101.       TabIndex        =   8
  102.       Top             =   5892
  103.       Value           =   1  'Checked
  104.       Width           =   1575
  105.    End
  106.    Begin VB.CommandButton cmdClear 
  107.       Caption         =   "Clear Surface"
  108.       Height          =   375
  109.       Left            =   4968
  110.       TabIndex        =   7
  111.       Top             =   3913
  112.       Width           =   1575
  113.    End
  114.    Begin VB.CommandButton cmdAnimate 
  115.       Caption         =   "&Animate Picture"
  116.       Height          =   375
  117.       Left            =   4968
  118.       TabIndex        =   6
  119.       Top             =   1057
  120.       Width           =   1575
  121.    End
  122.    Begin VB.CommandButton cmdStar 
  123.       Caption         =   "Stars"
  124.       Height          =   375
  125.       Left            =   4968
  126.       TabIndex        =   5
  127.       Top             =   2009
  128.       Width           =   1575
  129.    End
  130.    Begin VB.CommandButton cmdSort 
  131.       Caption         =   "Sort Cards"
  132.       Height          =   375
  133.       Left            =   4968
  134.       TabIndex        =   4
  135.       Top             =   2961
  136.       Width           =   1575
  137.    End
  138.    Begin VB.Timer tmrAnimate 
  139.       Enabled         =   0   'False
  140.       Interval        =   10
  141.       Left            =   240
  142.       Top             =   6885
  143.    End
  144.    Begin VB.CommandButton cmdBack 
  145.       Caption         =   "Card Backs"
  146.       Height          =   375
  147.       Left            =   4968
  148.       TabIndex        =   3
  149.       Top             =   3437
  150.       Width           =   1575
  151.    End
  152.    Begin VB.CommandButton cmdShuffle 
  153.       Caption         =   "Shuffle Cards"
  154.       Height          =   375
  155.       Left            =   4968
  156.       TabIndex        =   2
  157.       Top             =   2485
  158.       Width           =   1575
  159.    End
  160.    Begin VB.CommandButton cmdExit 
  161.       Caption         =   "Exit"
  162.       Height          =   375
  163.       Left            =   4968
  164.       TabIndex        =   1
  165.       Top             =   4380
  166.       Width           =   1575
  167.    End
  168.    Begin VB.CommandButton cmdBmpSpiral 
  169.       Caption         =   "Bitmap Spiral"
  170.       Height          =   375
  171.       Left            =   4968
  172.       TabIndex        =   0
  173.       Top             =   105
  174.       Width           =   1575
  175.    End
  176.    Begin VB.Label lblMaskColorText 
  177.       Caption         =   "Mask Color"
  178.       Height          =   228
  179.       Left            =   5280
  180.       TabIndex        =   19
  181.       Top             =   5664
  182.       Width           =   1032
  183.    End
  184.    Begin VB.Label lblMaskColor 
  185.       BackColor       =   &H00FFFFFF&
  186.       BorderStyle     =   1  'Fixed Single
  187.       Height          =   228
  188.       Left            =   4956
  189.       TabIndex        =   18
  190.       Top             =   5664
  191.       Width           =   228
  192.    End
  193.    Begin VB.Label lblFormColor 
  194.       BorderStyle     =   1  'Fixed Single
  195.       Height          =   228
  196.       Left            =   4968
  197.       TabIndex        =   17
  198.       Top             =   5316
  199.       Width           =   228
  200.    End
  201.    Begin VB.Label lblFormColorText 
  202.       Caption         =   "Form Color"
  203.       Height          =   252
  204.       Left            =   5280
  205.       TabIndex        =   16
  206.       Top             =   5328
  207.       Width           =   1116
  208.    End
  209.    Begin VB.Image imgAniBmp 
  210.       BorderStyle     =   1  'Fixed Single
  211.       Height          =   384
  212.       Left            =   120
  213.       Picture         =   "fun.frx":0CFA
  214.       Stretch         =   -1  'True
  215.       Top             =   6168
  216.       Width           =   468
  217.    End
  218.    Begin VB.Image imgLargeBmp 
  219.       BorderStyle     =   1  'Fixed Single
  220.       Height          =   384
  221.       Left            =   120
  222.       Picture         =   "fun.frx":10C6
  223.       Stretch         =   -1  'True
  224.       Top             =   5688
  225.       Width           =   456
  226.    End
  227.    Begin VB.Image imgSmallBmp 
  228.       BorderStyle     =   1  'Fixed Single
  229.       Height          =   384
  230.       Left            =   120
  231.       Picture         =   "fun.frx":11508
  232.       Stretch         =   -1  'True
  233.       Top             =   5196
  234.       Width           =   456
  235.    End
  236.    Begin VB.Image imgBig 
  237.       Height          =   3072
  238.       Left            =   9552
  239.       Picture         =   "fun.frx":1178A
  240.       Top             =   2568
  241.       Visible         =   0   'False
  242.       Width           =   3072
  243.    End
  244.    Begin VB.Image imgLittle 
  245.       Height          =   384
  246.       Left            =   12288
  247.       Picture         =   "fun.frx":1980C
  248.       Top             =   1068
  249.       Visible         =   0   'False
  250.       Width           =   384
  251.    End
  252. End
  253. Attribute VB_Name = "FFun"
  254. Attribute VB_GlobalNameSpace = False
  255. Attribute VB_Creatable = False
  256. Attribute VB_PredeclaredId = True
  257. Attribute VB_Exposed = False
  258.  
  259. Option Explicit
  260.  
  261. Private dxCard As Long
  262. Private dyCard As Long
  263.  
  264. Private xInc As Single, yInc As Single
  265. Private xMove As Single, yMove As Single
  266. Private aCards(0 To 51) As Variant
  267. Private clrMask As Long
  268.  
  269. Private pgPicture As New CPictureGlass
  270.  
  271. Enum EAnimateType
  272.     eatNone
  273.     eatCardBacks
  274.     eatPicture
  275.     eatControl
  276. End Enum
  277.  
  278. Private eatAnimate As EAnimateType
  279.  
  280. Private WithEvents timerAnimate As CTimer
  281. Attribute timerAnimate.VB_VarHelpID = -1
  282.  
  283. Private Sub Form_Load()
  284.     
  285.     ChDir App.Path
  286.            
  287.     Set timerAnimate = New CTimer
  288.     SetClipControls Me.hWnd, chkClip.Value = vbChecked
  289.     clrMask = vbWhite
  290.     ' Initialize CARDS library and array
  291.     On Error GoTo CardsLoadFail
  292.     If cdtInit(dxCard, dyCard) = 0 Then
  293.         GoTo CardsLoadFail
  294.         cmdShuffle.Enabled = False
  295.         cmdBack.Enabled = False
  296.     Else
  297.         Dim i As Integer
  298.         For i = 0 To 51
  299.             aCards(i) = i
  300.         Next
  301.         ShuffleArray aCards()
  302.     End If
  303.     Exit Sub
  304.     
  305. CardsLoadFail:
  306.     cmdSort.Enabled = False
  307.     cmdShuffle.Enabled = False
  308.     cmdBack.Enabled = False
  309.     
  310. End Sub
  311.  
  312. Private Sub chkClip_Click()
  313.     SetClipControls Me.hWnd, chkClip.Value = vbChecked
  314. End Sub
  315.  
  316. Private Sub chkAutoRedraw_Click()
  317.     AutoRedraw = (chkAutoRedraw = vbChecked)
  318. End Sub
  319.  
  320. Private Sub cmdAnimate_Click()
  321.     If cmdAnimate.Caption = "&Animate Picture" Then
  322.         With pgPicture
  323.             ' Draw picture on center of form with white background
  324.             .Create Me, imgAniBmp.Picture, clrMask, Width / 2, Height / 2
  325.             ' Constant controls pace, sign controls direction
  326.             xInc = .Width * 0.05
  327.             yInc = -.Height * 0.05
  328.         End With
  329.         SetTimer eatPicture
  330.         cmdAnimate.Caption = "Stop &Animate"
  331.     Else
  332.         SetTimer eatNone
  333.         cmdAnimate.Caption = "&Animate Picture"
  334.     End If
  335. End Sub
  336.  
  337. Private Sub cmdAnimateCtl_Click()
  338.     If cmdAnimateCtl.Caption = "Animate &Control" Then
  339.         With pgControl
  340.             Set .Picture = imgAniBmp.Picture
  341.             .MaskColor = clrMask
  342.             .Left = (ScaleWidth / 2) - (.Width / 2)
  343.             .Top = (ScaleHeight / 2) - (.Height / 2)
  344.             ' Constant controls pace, sign controls direction
  345.             xInc = .Width * 0.05
  346.             yInc = -.Height * 0.05
  347.             .Visible = True
  348.         End With
  349.         SetTimer eatControl
  350.         cmdAnimateCtl.Caption = "Stop &Animate"
  351.     Else
  352.         SetTimer eatNone
  353.         cmdAnimateCtl.Caption = "Animate &Control"
  354.     End If
  355. End Sub
  356.  
  357. Private Sub cmdBack_Click()
  358.     Dim ordScale As Integer
  359.     ordScale = ScaleMode: ScaleMode = vbPixels
  360.     SetTimer eatCardBacks
  361.     Cls
  362.     Dim X As Integer, Y As Integer, ecbBack As ECardBack
  363.     ecbBack = ecbCrossHatch  ' First card back
  364.     ' Draw cards in 4 by 4 grid
  365.     For X = 0 To 3
  366.         For Y = 0 To 3
  367.             cdtDraw Me.hDC, (dxCard * 0.1) + (X * dxCard * 1.1), _
  368.                     (dyCard * 0.1) + (Y * dyCard * 1.1), _
  369.                     ecbBack, ectBacks, QBColor(Random(0, 15))
  370.             ecbBack = ecbBack + 1
  371.         Next
  372.     Next
  373.     ScaleMode = ordScale
  374. End Sub
  375.  
  376. ' Secret undocumented command for animating card backs a click at a time
  377. Private Sub cmdBack_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  378.     If Button = 2 Then
  379.         Static f As Boolean
  380.         If f = False Then
  381.             cmdBack_Click
  382.             f = True
  383.             SetTimer eatNone
  384.         End If
  385.         AnimateBacks
  386.     End If
  387.     
  388. End Sub
  389.  
  390. Private Sub cmdBmpSpiral_Click()
  391.     SetTimer eatNone
  392.     BmpSpiral Me, imgSmallBmp.Picture
  393.     imgSmallBmp.Refresh
  394.     imgLargeBmp.Refresh
  395.     imgAniBmp.Refresh
  396. End Sub
  397.  
  398. Private Sub cmdSpiralBmp_Click()
  399.     SetTimer eatNone
  400.     Dim X As Long, Y As Long
  401.     X = ((Width - (cmdSpiralBmp.Width * 1.2)) / 2) - (ScaleX(imgLargeBmp.Picture.Width) / 2)
  402.     Y = ((Height - (cmdSpiralBmp.Height * 1.2)) / 2) - (ScaleY(imgLargeBmp.Picture.Height) / 2)
  403.     SpiralBmp Me, imgLargeBmp.Picture, X, Y
  404. End Sub
  405.  
  406. Private Sub cmdClear_Click()
  407.     SetTimer eatNone
  408.     Cls
  409. End Sub
  410.  
  411. Private Sub cmdExit_Click()
  412.     Unload Me
  413. End Sub
  414.  
  415. Private Sub cmdSmallBmp_Click()
  416.     Call FillPicture(imgSmallBmp)
  417.     cmdClear_Click
  418. End Sub
  419.  
  420. Private Sub cmdLargeBmp_Click()
  421.     Call FillPicture(imgLargeBmp)
  422.     cmdClear_Click
  423. End Sub
  424.  
  425. Private Sub cmdAniBmp_Click()
  426.     Call FillPicture(imgAniBmp)
  427.     cmdClear_Click
  428. End Sub
  429.  
  430. Private Sub cmdStar_Click()
  431.     SetTimer eatNone
  432.     Dim i As Integer, xMid As Long, yMid As Long, dxyRadius As Long
  433.     For i = 1 To Random(5, 20)
  434.         dxyRadius = Random(Height / 8, Height / 4)
  435.         xMid = Random(1, Width): yMid = Random(1, Height)
  436.         ' Black border and two random colors
  437.         Star Me, xMid, yMid, dxyRadius, vbBlack, _
  438.              QBColor(Random(1, 15)), QBColor(Random(1, 15))
  439.         ' Black border and one random color
  440.         'Star Me, xMid, yMid, dxyRadius, vbBlack, QBColor (Random(1, 15))
  441.         ' One filled color
  442.         'Star Me, xMid, yMid, dxyRadius, QBColor(Random(1, 15))
  443.     Next
  444.     imgSmallBmp.Refresh
  445.     imgLargeBmp.Refresh
  446.     imgAniBmp.Refresh
  447. End Sub
  448.  
  449.  
  450. Private Function FillPicture(pic As Control) As Boolean
  451.     Dim opfile As New COpenPictureFile
  452.     With opfile
  453.         .InitDir = App.Path
  454.         .FilterType = efpBitmap
  455.         .Load Left + (Width * 0.3), Top + (Height * 0.4)
  456.         If .filename <> sEmpty And .picType = vbPicTypeBitmap Then
  457.             pic.Picture = LoadPicture(.filename)
  458.         End If
  459.     End With
  460. End Function
  461.  
  462. Private Sub cmdShuffle_Click()
  463.     SetTimer eatNone
  464.     Dim ordScale As Integer
  465.     ordScale = ScaleMode: ScaleMode = vbPixels
  466.     ShuffleArray aCards()
  467.     ShowCards aCards()
  468.     ScaleMode = ordScale
  469. End Sub
  470.  
  471. Private Sub cmdSort_Click()
  472.     SetTimer eatNone
  473.     Dim ordScale As Integer
  474.     ordScale = ScaleMode: ScaleMode = vbPixels
  475.     SortArray aCards(), 0, 51
  476.     ShowCards aCards()
  477.     ScaleMode = ordScale
  478. End Sub
  479.  
  480. Private Sub Form_Paint()
  481.     If eatAnimate = eatControl Then pgControl.Refresh
  482. End Sub
  483.  
  484. Private Sub Form_Unload(Cancel As Integer)
  485.     Dim f As Integer
  486.     If cmdSort.Enabled Then cdtTerm
  487. End Sub
  488.  
  489. Private Sub imgAniBmp_Click()
  490.     cmdAniBmp_Click
  491. End Sub
  492.  
  493. Private Sub imgLargeBmp_Click()
  494.     cmdLargeBmp_Click
  495. End Sub
  496.  
  497. Private Sub imgSmallBmp_Click()
  498.     cmdSmallBmp_Click
  499. End Sub
  500.  
  501. Sub AnimateBacks()
  502.     Static X As Integer, Y As Integer
  503.     Static ecbBack As ECardBack, iState As Integer
  504.     
  505.     ' Save scale mode and change to pixels
  506.     Dim ordScale As Integer
  507.     ordScale = ScaleMode: ScaleMode = vbPixels
  508.     
  509.     ' Adjust variables
  510.     If ecbBack < ecbCrossHatch Or ecbBack > ecbO Then
  511.         ecbBack = ecbCrossHatch
  512.         X = 0: Y = 0
  513.     End If
  514.     If X = 4 Then X = 0
  515.     If Y = 4 Then Y = 0: X = X + 1
  516.     Select Case ecbBack
  517.     Case ecbCrossHatch
  518.         ' Change color of crosshatch
  519.         cdtDraw Me.hDC, (dxCard * 0.1) + (X * dxCard * 1.1), _
  520.                 (dyCard * 0.1) + (Y * dyCard * 1.1), _
  521.                 ecbBack, ectBacks, QBColor(Random(0, 15))
  522.     Case Else 'ecbRobot, ecbCastle, ecbBeach, ecbCardHand
  523.         ' Step through animation states
  524.         If cdtAnimate(Me.hDC, ecbBack, _
  525.                       (dxCard * 0.1) + (X * dxCard * 1.1), _
  526.                       (dyCard * 0.1) + (Y * dyCard * 1.1), iState) Then
  527.             iState = iState + 1
  528.             ScaleMode = ordScale
  529.             Exit Sub    ' Don't move to next card until final state
  530.         End If
  531.         iState = 0
  532.     ' Case Else
  533.         ' Ignore other cards
  534.     End Select
  535.     ' Move to next card
  536.     ecbBack = ecbBack + 1
  537.     Y = Y + 1
  538.     ' Restore
  539.     ScaleMode = ordScale
  540. End Sub
  541.  
  542. Private Sub AnimatePicture()
  543.     With pgPicture
  544.         If .Left + .Width > ScaleWidth Then xInc = -xInc
  545.         If .Left <= Abs(xInc) Then xInc = -xInc
  546.         If .Top + .Height > ScaleHeight Then yInc = -yInc
  547.         If .Top <= Abs(yInc) Then yInc = -yInc
  548.         .Move .Left + xInc, .Top + yInc
  549.     End With
  550. End Sub
  551.  
  552. Private Sub AnimateControl()
  553.     With pgControl
  554.         If .Left + .Width > ScaleWidth Then xInc = -xInc
  555.         If .Left <= Abs(xInc) Then xInc = -xInc
  556.         If .Top + .Height > ScaleHeight Then yInc = -yInc
  557.         If .Top <= Abs(yInc) Then yInc = -yInc
  558.         .Move .Left + xInc, .Top + yInc
  559.     End With
  560. End Sub
  561.  
  562. Private Sub SetTimer(eatAnimateA As Integer)
  563.     eatAnimate = eatAnimateA
  564.     Select Case eatAnimate
  565.     Case eatNone
  566.         timerAnimate.Interval = 0
  567.         ' Hide XPictureGlass object
  568.         pgControl.Visible = False
  569.         cmdAnimate.Caption = "&Animate Picture"
  570.         cmdAnimateCtl.Caption = "Animate &Control"
  571.         ' Remove active CPictureGlass object from memory
  572.         Set pgPicture = Nothing
  573.     Case eatPicture, eatControl
  574.         timerAnimate.Interval = 10
  575.     Case eatCardBacks
  576.         timerAnimate.Interval = 100
  577.     End Select
  578. End Sub
  579.  
  580. Private Sub ShowCards(aCards() As Variant)
  581.     Dim iSuit As Integer, iCard As Integer
  582.     
  583.     For iCard = 0 To 12
  584.         For iSuit = 0 To 3
  585.             cdtDraw Me.hDC, (dxCard * 0.3) + (iSuit * dxCard), _
  586.                     (dyCard * 0.1) + iCard * (dyCard / 3.7), _
  587.                     aCards(iSuit + (iCard * 4)), 0, 0&
  588.         Next
  589.     Next
  590. End Sub
  591.     
  592. Sub SetClipControls(hWnd As Long, f As Boolean)
  593.     ' You want to do this:
  594.     'Me.ClipControls = f
  595.     ' But Visual Basic won't let you; do this instead:
  596.     ChangeStyleBit hWnd, f, WS_CLIPCHILDREN
  597. End Sub
  598.  
  599. Private Sub lblFormColor_MouseUp(Button As Integer, Shift As Integer, _
  600.                                  X As Single, Y As Single)
  601.     Dim getclr As New CColorPicker
  602.     getclr.Color = lblFormColor.BackColor
  603.     getclr.Load Left + lblFormColor.Left + X, Top + lblFormColor.Top + Y
  604.     lblFormColor.BackColor = getclr.Color
  605.     BackColor = getclr.Color
  606.     chkClip.BackColor = getclr.Color
  607.     chkAutoRedraw.BackColor = getclr.Color
  608.     lblFormColorText.BackColor = getclr.Color
  609.     lblMaskColorText.BackColor = getclr.Color
  610. End Sub
  611.  
  612. Private Sub lblFormColorText_MouseUp(Button As Integer, Shift As Integer, _
  613.                                      X As Single, Y As Single)
  614.     lblFormColor_MouseUp Button, Shift, X, Y
  615. End Sub
  616.  
  617. Private Sub lblMaskColor_MouseUp(Button As Integer, Shift As Integer, _
  618.                                  X As Single, Y As Single)
  619.     Dim getclr As New CColorPicker
  620.     getclr.Color = lblMaskColor.BackColor
  621.     getclr.Load Left + lblMaskColor.Left + X, Top + lblMaskColor.Top + Y
  622.     lblMaskColor.BackColor = getclr.Color
  623.     clrMask = getclr.Color
  624. End Sub
  625.  
  626. Private Sub lblMaskColorText_MouseUp(Button As Integer, Shift As Integer, _
  627.                                      X As Single, Y As Single)
  628.     lblMaskColor_MouseUp Button, Shift, X, Y
  629. End Sub
  630.  
  631. Private Sub timerAnimate_ThatTime()
  632.     Select Case eatAnimate
  633.     Case eatNone
  634.         Exit Sub
  635.     Case eatCardBacks
  636.         AnimateBacks
  637.     Case eatPicture
  638.         AnimatePicture
  639.     Case eatControl
  640.         AnimateControl
  641.     End Select
  642. End Sub
  643. '
  644.